﻿#ifndef __X2D_APPLICATION_PROTOCOL_H__
#define __X2D_APPLICATION_PROTOCOL_H__

#include "win32/x2platformdefine.h"

NS_X2_BEGINE

enum TargetPlatform
{
    kTargetWindows,
    kTargetLinux,
    kTargetMacOS,
    kTargetAndroid,
    kTargetIphone,
    kTargetIpad,
};

class X2_DLL x2ApplicationProtocol
{
public:

    virtual ~x2ApplicationProtocol() {}

    /**
    @brief    Implement CCDirector and CCScene init code here.
    @return true    Initialize success, app continue.
    @return false   Initialize failed, app terminate.
    */
    virtual bool applicationDidFinishLaunching() = 0;

    /**
    @brief  The function be called when the application enter background
    @param  the pointer of the application
    */
    virtual void applicationDidEnterBackground() = 0;

    /**
    @brief  The function be called when the application enter foreground
    @param  the pointer of the application
    */
    virtual void applicationWillEnterForeground() = 0;

    /**
    @brief    Callback by CCDirector for limit FPS.
    @interval       The time, expressed in seconds, between current frame and next. 
    */
    virtual void setAnimationInterval(double interval) = 0;

    /**
    @brief Get target platform
    */
    virtual TargetPlatform getTargetPlatform() = 0;
};

NS_X2_END

#endif // __X2D_APPLICATION_PROTOCOL_H__